from rest_framework.permissions import BasePermission


class MyPermission1(BasePermission):
    message = {"status": False, "msg": "无权访问1"}

    def has_permission(self, request, view):
        # v1 = random.randint(1, 3)
        # if v1 == 2:
        #     return True
        print(f'MyPermission1')
        return True


class MyPermission2(BasePermission):
    message = {"status": False, "msg": "无权访问2"}

    def has_permission(self, request, view):
        # v1 = random.randint(1, 3)
        # if v1 == 2:
        #     return True
        print(f'MyPermission2')
        return False


class MyPermission3(BasePermission):
    message = {"status": False, "msg": "无权访问3"}

    def has_permission(self, request, view):
        # v1 = random.randint(1, 3)
        # if v1 == 2:
        #     return True
        print(f'MyPermission3')
        return True
